import { PianoSymbol } from './types/types';
import { PianoUtil } from './utils/piano';

document.addEventListener('DOMContentLoaded', () => {
    const doms: HTMLElement[] = Array.from(document.querySelectorAll('.piano-item'));

    doms.forEach(el => {
        const symbol = (el.dataset.symbol as string).toUpperCase();
        el.addEventListener('click', () => {
            PianoUtil.playSound(symbol as PianoSymbol, 200);
        });
    });
});